package com.github.livebase.log;

import android.text.TextUtils;

import com.github.livebase.util.base.ObjectsUtil;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.UnknownHostException;

/**
 * @ClassName Log
 * @description:
 * @author: biao532
 * @create: 2024-02-02 12:07
 * @Version 1.0
 **/
public interface Logger {

    boolean isTrance();

    void trance(String tag, Throwable throwable, String format, Object... params);

    default void trance(String tag, Throwable throwable) {
        trance(tag, throwable, ObjectsUtil.Empty.STRING);
    }
    default void trance(String tag, String message, Object... params) {
        trance(tag, null, message, params);
    }


    boolean isDebug();

    void debug(String tag, Throwable throwable, String format, Object... params);

    default void debug(String tag, Throwable throwable) {
        debug(tag, throwable, ObjectsUtil.Empty.STRING);
    }

    default void debug(String tag, String format, Object... params) {
        debug(tag, null, format, params);
    }

    boolean isInfo();

    void info(String tag, Throwable throwable, String format, Object... params);

    default void info(String tag, String message, Object... params) {
        info(tag, null, message, params);
    }

    default void info(String tag, Throwable throwable) {
        info(tag, throwable, ObjectsUtil.Empty.STRING);
    }

    boolean isWarm();
    void warn(String tag, Throwable throwable, String format, Object... params);

    default void warn(String tag, String message, Object... params) {
        warn(tag, null, message, params);
    }

    default void warn(String tag, Throwable throwable) {
        warn(tag, throwable, ObjectsUtil.Empty.STRING);
    }

    boolean isError();

    void error(String tag, Throwable throwable, String format, Object... params);

    default void error(String tag, String message, Object... params) {
        error(tag, null, message, params);
    }

    default void error(String tag, Throwable throwable) {
        error(tag, throwable, ObjectsUtil.Empty.STRING);
    }
}
